<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter" %>
<%@ page import="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter" %>
<%@ page import="org.springframework.security.core.AuthenticationException" %>
<%@ taglib prefix="s" uri="/struts-tags"%>

<html>
<head>
	<title>Login</title>
	<script type="text/javascript">
	
		$(document).ready(function() {
			$("#loginForm").validate({
				rules: {
					j_username: {
						required: true
					},
					j_password: {
						required: true
					}
				},
				//messages与上面rules一一对应, 如果不写, 则显示框架缺省消息
				messages: {
					j_username: {
						required: "required"
					},
					j_password: {
						required: "required"
					}
				}
			});
			
		});
	
		if (window != top) { 
            top.location = window.location;  
		}
		

	</script>
</head>
<body >


 <div class="content">
    <div class="pageTitle" >Welcome to Holistic Programme Planning System - HPP</div>
    <br/>
    <br/>
    <div class="box" style="width:400px" >
      <div class="top">
        <div class="left">
          <div class="right">
            <div class="center"></div>
          </div>
        </div>
      </div>
      
      <div class="middle">
        <div class="left">
          <div class="right">
            <div class="center">
              <div class="title"><font color="#FFFFFF">Login</font></div>
              
              <div class="content">
              <form id="loginForm" name="loginForm" action="<s:url value="/j_spring_security_check"/>" method="post" AUTOCOMPLETE = "off">
                <div style="height: 30px;">
				<%
				if(request.getParameter("expireSession")!=null){%> 
					<div class="error">This session has been expired (possibly due to multiple concurrent logins being attempted as the same user).</div> 
				<%}%>
				
				<%
				if (session.getAttribute(AbstractAuthenticationProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY) != null) {%> 
					<div class="error"> Login failed, please try again.</div> 
				<%}%>
			    
			    </div>          
                <div class="form" align="center">
                
                  <table border="0" cellspacing="3" cellpadding="0" style="width:100%;">
				     <tr>
				        <td class="sep" style="width:100px;height:2px;"><img src="<s:url value='/images/spacer.gif'/>" style="width:100px;height:2px" /></td>
				        <td class="sep sep2" ><img src="<s:url value='/images/spacer.gif'/>" /></td>
				     </tr>                  
                    <tr>
                      <td class="fLabel" align="right">Login ID :</td>
                      <td class="fField" align="left"><input type='text' size="12" maxlength="60" id='j_username' name='j_username' value="" style="width:150px"/></td>
                    </tr>
                    <tr>
                      <td class="fLabel" align="right">Password :</td>
                      <td class="fField" align="left"><input type='password' size="12" id='j_password' name='j_password' value="" style="width:150px"/></td>
                    </tr>
                    <tr>
                      <td class="fLabel" >&nbsp;</td>
                      <td class="fField" style="padding:10px 10px; text-align:left" >
                      	<div class="button" >
                          <div class="left" >
                            <div class="right" >
                              <input class="inputButton"  id="enterSubmit" value="Login"  type="submit"/>
                            </div>
                          </div>
                        </div>
                      </td>
                    </tr>
                  </table>
                  
                </div>
                
                </form>
                
                <br/>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="bottom">
        <div class="left">
          <div class="right">
            <div class="center"></div>
          </div>
        </div>
      </div>
    </div>
    <!-- InstanceEndEditable --> 
    </div>

</body>
</html>